import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';

@Entity('member_api')
export class MemberApi {
  @PrimaryGeneratedColumn({
    name: 'api_id',
    type: 'int',
    comment: '接口id',
  })
  apiId: number;

  @Column({
    name: 'api_pid',
    type: 'int',
    nullable: false,
    default: 0,
    comment: '接口pid',
  })
  apiPid: number;

  @Column({
    name: 'api_name',
    type: 'varchar',
    length: 255,
    nullable: false,
    default: '',
    comment: '接口名称',
  })
  apiName: string;

  @Column({
    name: 'api_url',
    type: 'varchar',
    length: 255,
    default: '',
    comment: '接口链接',
  })
  apiUrl: string;

  @Column({
    name: 'sort',
    type: 'int',
    width: 10,
    default: 250,
    comment: '排序',
  })
  sort: number;

  @Column({
    name: 'is_unlogin',
    type: 'tinyint',
    nullable: false,
    default: 0,
    comment: '是否免登，1是0否',
  })
  isUnlogin: number;

  @Column({
    name: 'is_unauth',
    type: 'tinyint',
    nullable: false,
    default: 0,
    comment: '是否免权，1是0否',
  })
  isUnauth: number;

  @Column({
    name: 'is_unrate',
    type: 'tinyint',
    nullable: false,
    default: 0,
    comment: '是否免限，1是0否',
  })
  isUnrate: number;

  @Column({
    name: 'is_disable',
    type: 'tinyint',
    nullable: false,
    default: 0,
    comment: '是否禁用，1是0否',
  })
  isDisable: number;

  @Column({
    name: 'is_delete',
    type: 'tinyint',
    nullable: false,
    default: 0,
    comment: '是否删除，1是0否',
  })
  isDelete: number;

  @Column({
    name: 'create_uid',
    type: 'int',
    default: 0,
    comment: '添加用户id',
  })
  createUid: number;

  @Column({
    name: 'update_uid',
    type: 'int',
    default: 0,
    comment: '修改用户id',
  })
  updateUid: number;

  @Column({
    name: 'delete_uid',
    type: 'int',
    default: 0,
    comment: '删除用户id',
  })
  deleteUid: number;

  @Column({
    name: 'create_time',
    type: 'datetime',
    nullable: true,
    comment: '添加时间',
  })
  createTime: Date;

  @Column({
    name: 'update_time',
    type: 'datetime',
    nullable: true,
    comment: '修改时间',
  })
  updateTime: Date;

  @Column({
    name: 'delete_time',
    type: 'datetime',
    nullable: true,
    comment: '删除时间',
  })
  deleteTime: Date;
}